<HTML>
<HEAD>
<TITLE>Dm Object Documentation</TITLE>
</HEAD>
<BODY>
<A HREF="#toc">Table of Contents</A><P>
_________________________________________________________________
<P>

<H2><A NAME="sect1" HREF="#toc1"><B>NAME</B></A></H2>
dm_open - create and manipulate a display manager object.
<P>

<H2><A NAME="sect2" HREF="#toc2"><B>SYNOPSIS</B></A></H2>
<B>dm_open</B> [<I>pathName type</I> [<I>options</I>]]
<P>

<H2><A NAME="sect4" HREF="#toc4"><B>COMMAND LINE OPTIONS</B></A></H2>
<DL>
<DT>Option: <DD>          <B>-N</B> <I>height</I>
</DD>
</DL>
Specifies the window's height (i.e. number of raster lines).
<P>
<DL>
<DT>Option: <DD>          <B>-W</B> <I>width</I>
</DD>
</DL>
Specifies the window's width.
<P>
<DL>
<DT>Option: <DD>          <B>-S</B> <I>size</I>
</DD>
</DL>
Specifies the window's square size (i.e. width and height).
<P>
<DL>
<DT>Option: <DD>          <B>-i</B> <I>initproc</I>
</DD>
</DL>
Specifies the initialization proc. This proc is called
with the <I>pathName</I> as an argument.
<P>
<DL>
<DT>Option: <DD>          <B>-t</B> <I>0|1</I>
</DD>
</DL>
Specifies the toplevel flag. 0 indicates the display manager
object is an internal window, while 1 indicates a toplevel window.
<P>
<DL>
<DT>Option: <DD>          <B>-d</B> <I>dpy</I>
</DD>
</DL>
Specifies the display string in a format understood by X windows.
<P>

<H2><A NAME="sect8" HREF="#toc8"><B>DESCRIPTION</B></A></H2>
The <B>dm_open</B> command creates a new window
(given by the <I>pathName</I> argument) and makes it into
a display manager object for displaying geometry.
Additional options, described above, may be specified on the
command line to configure aspects of the display manager object.
The <B>dm_open</B> command returns its <I>pathName</I> argument.
At the time this command is invoked, there must not exist a
window named <I>pathName</I>, but pathName's parent must exist.
<P>

<H2><A NAME="sect9" HREF="#toc9"><B>METHODS</B></A></H2>
The <B>dm_open</B> command creates a new Tcl command whose name
is <I>pathName</I>. This command may be used to invoke various
operations on the display manager object. It has the following general
form:
<P>
<I>pathName</I> <I>option</I> ?<I>arg</I> <I>arg</I> ...?
<P>
<I>Option</I> and the <I>arg</I>s determine the exact behavior of the command.
The following commands are possible for display manager objects:
<P>

<DL>
<DT><I>pathName</I> <A NAME="bg"><B>bg</B></A> [&quot;<I>r g b</I>&quot;]</DT>
<DD>Set/get the background color. The rgb components
are expected to be integers between 0 and 255.
</DD>
<P>
<DT><I>pathName</I> <A NAME="bounds"><B>bounds</B></A> [<I>xmin xmax ymin ymax zmin zmax</I>]</DT>
<DD>Set/get the window bounds. Some display managers use this
to calculate clipping planes (i.e. X).
</DD>
<P>
<DT><I>pathName</I> <A NAME="clear"><B>clear</B></A></DT>
<DD>Clear the drawing area using the background color.
</DD>
<P>
<DT><I>pathName</I> <A NAME="close"><B>close</B></A></DT>
<DD>Close the display manager object.
</DD>
<P>
<DT><I>pathName</I> <A NAME="configure"><B>configure</B></A></DT>
<DD>Called to handle Configure events.
</DD>
<P>
<DT><I>pathName</I> <A NAME="debug"><B>debug</B></A> [<I>0</I>|<I>1</I>]</DT>
<DD>Set/get debug mode. <I>0</I> indicates debugging
is off while <I>1</I> indicates debugging is on.
</DD>
<P>
<DT><I>pathName</I> <A NAME="drawBegin"><B>drawBegin</B></A></DT>
<DD>Begin the drawing sequence.
</DD>
<P>
<DT><I>pathName</I> <A NAME="drawEnd"><B>drawEnd</B></A></DT>
<DD>End the drawing sequence. This will cause the
graphics pipe to be flushed.
</DD>
<P>
<DT><I>pathName</I> <A NAME="drawGeom"><B>drawGeom</B></A> geo_obj(s)</DT>
<DD>Draw one or more drawable geometry objects.
</DD>
<P>
<DT><I>pathName</I> <A NAME="drawLine"><B>drawLine</B></A> <I>x1 y1 x2 y2</I></DT>
<DD>Draw the 2D line indicated by endpoints (x1, y1) and
(x2, y2). The given coordinates are expected to be in the
range [-1, 1].
</DD>
<P>
<DT><I>pathName</I> <A NAME="drawPoint"><B>drawPoint</B></A> <I>x y</I></DT>
<DD>Draw the 2D point at position (<I>x</I>, <I>y</I>).
</DD>
<P>
<DT><I>pathName</I> <A NAME="drawSList"><B>drawSList</B></A> <I>slp</I></DT>
<DD>Draw the solid list specified by the solid list pointer (i.e.<I>slp</I>).
</DD>
<P>
<DT><I>pathName</I> <A NAME="drawString"><B>drawString</B></A> <I>str x y size use_aspect</I></DT>
<DD>Draw the 2D string starting at position (<I>x</I>, <I>y</I>).
The <I>x</I> and <I>y</I> coordinates are expected to be in the
range [-1, 1].
The <I>size </I> is currently ignored. The <I>use_aspect</I> flag indicates
whether or not to use the aspect ratio to modify the starting position.
</DD>
<P>
<DT><I>pathName</I> <A NAME="drawVList"><B>drawVList</B></A> <I>vlp</I></DT>
<DD>Draw the vector list specified by the vector list pointer (i.e.<I>vlp</I>).
</DD>
<P>
<DT><I>pathName</I> <A NAME="fg"><B>fg</B></A> [&quot;<I>r g b</I>&quot;]</DT>
<DD>Set/get the foreground color. The rgb components
are expected to be integers between 0 and 255.
</DD>
<P>
<DT><I>pathName</I> <A NAME="flush"><B>flush</B></A></DT>
<DD>Flushes the X server's request buffer.
</DD>
<P>
<DT><I>pathName</I> <A NAME="get_aspect"><B>get_aspect</B></A></DT>
<DD>Get the window's aspect ratio (i.e. width / height).
</DD>
<P>
<DT><I>pathName</I> <A NAME="light"><B>light</B></A> [<I>0</I>|<I>1</I>]</DT>
<DD>Set/get light mode. <I>0</I> indicates light
is off while <I>1</I> indicates light is on.
</DD>
<P>
<DT><I>pathName</I> <A NAME="linestyle"><B>linestyle</B></A> [<I>0</I>|<I>1</I>]</DT>
<DD>Set/get linestyle. <I>0</I> indicates solid lines
while <I>1</I> indicates dashed lines.
</DD>
<DT><I>pathName</I> <A NAME="linewidth"><B>linewidth</B></A> [<I>width</I>]</DT>
<DD>Set/get linewidth. This setting determines how fat
to draw the wireframe lines.
</DD>
<P>
<DT><I>pathName</I> <A NAME="listen"><B>listen</B></A> [<I>port</I>]</DT>
<DD>Set/get the port used to listen for framebuffer clients.
<I>Port</I> values less than zero turn off listening.
</DD>
<P>
<DT><I>pathName</I> <A NAME="loadmat"><B>loadmat</B></A> <I>mat</I></DT>
<DD>Load the matrix, <I>mat</I>, into the display manager.
This is typically a model2view matrix.
</DD>
<P>
<DT><I>pathName</I> <A NAME="normal"><B>normal</B></A></DT>
<DD>Restore display manager to a normal mode of operation
(i.e. not scaled, rotated, displaced, etc.).
</DD>
<P>
<DT><I>pathName</I> <A NAME="observer"><B>observer</B></A> [<I>subcommand</I>]</DT>
<DD>This command is used to maintain a list of observers. Observers
are objects who have registered an interest in when this display
manager object receives pixels in its role as a framebuffer server.
Whenever pixel data is received the observers on the list are notified.
<P>
	<DL>
	<DT><I>pathName observer</I> <B>attach</B> <I>obs</I> [<I>command</I>]</DT>
	<DD>Add the specified observer, <I>obs</I>, to the list of observers.
	If <I>command</I> is specified then it is executed each time pixel data
	is received. Otherwise, the observer is expected to have an update method
	which is called with the name of this display manager object as an argument.
	</DD>
<P>
	<DT><I>pathName observer</I> <B>detach</B> <I>obs</I></DT>
	<DD>Remove the specified observer, <I>obs</I>, from the list of observers.
	</DD>
<P>
	<DT><I>pathName observer</I> <B>show</B></DT>
	<DD>Return the list of observers for this display manager object.
	</DD>
	</DL>
</DD>
<P>
<DT><I>pathName</I> <A NAME="perspective"><B>perspective</B></A> [<I>0</I>|<I>1</I>]</DT>
<DD>Set/get perspective mode. <I>0</I> indicates perspective
is off, while <I>1</I> indicates perspective is on.
</DD>
<P>
<DT><I>pathName</I> <A NAME="refreshfb"><B>refreshfb</B></A></DT>
<DD>Draws/displays the pixels stored in the widget's framebuffer.
</DD>
<P>
<DT><I>pathName</I> <A NAME="size"><B>size</B></A> [<I>width height</I>]</DT>
<DD>Set/get the window size.
</DD>
<P>
<DT><I>pathName</I> <A NAME="sync"><B>sync</B></A></DT>
<DD>Flushes the X server's request buffer and waits until all events
have been processed.
</DD>
<P>
<DT><I>pathName</I> <A NAME="zbuffer"><B>zbuffer</B></A> [<I>0</I>|<I>1</I>]</DT>
<DD>Set/get zbuffer mode. <I>0</I> indicates that zbuffer
is off, while <I>1</I> indicates zbuffer is on.
</DD>
<P>
<DT><I>pathName</I> <A NAME="zclip"><B>zclip</B></A> [<I>0</I>|<I>1</I>]</DT>
<DD>Set/get zclipping mode. <I>0</I> indicates zclipping
is off, while <I>1</I> indicates zclipping is on.
</DD>
</DL>
<P>

<H2><A NAME="sect16" HREF="#toc16"><B>EXAMPLE</B></A></H2>
The following sequence creates a display manager object and draws
two yellow lines that connect the opposite corners of the window.
<P>
cwish> dm_open .d X -t 0 -s 400
<BR>
.d
<BR>
cwish> pack .d -expand yes -fill both
<BR>
cwish> .d drawBegin
<BR>
cwish> .d fg "255 255 0"
<BR>
cwish> .d drawLine -1 1 1 -1
<BR>
cwish> .d drawLine -1 -1 1 1
<BR>
cwish> .d drawEnd
<P>

<H2><A NAME="sect17" HREF="#toc17"><B>ACKNOWLEDGMENTS:</B></A></H2>

Mark L. Ulferts &lt;mulferts@austin.dsccc.com&gt;
<PRE>        Basic layout for documenting classes.</PRE>
<P>

<H2><A NAME="sect18" HREF="#toc18"><B>AUTHOR</B></A></H2>
<P>
Robert G. Parker
<P>

<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc1" HREF="#sect1">NAME</A></LI>
<LI><A NAME="toc2" HREF="#sect2">SYNOPSIS</A></LI>
<LI><A NAME="toc4" HREF="#sect4">COMMAND LINE OPTIONS</A></LI>
<LI><A NAME="toc8" HREF="#sect8">DESCRIPTION</A></LI>
<LI><A NAME="toc9" HREF="#sect9">METHODS</A></LI>
<LI><A NAME="toc16" HREF="#sect16">EXAMPLE</A></LI>
<LI><A NAME="toc17" HREF="#sect17">ACKNOWLEDGMENTS</A></LI>
<LI><A NAME="toc18" HREF="#sect18">AUTHOR</A></LI>
</UL>
</BODY>
</HTML>
